<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    pre {
      font-size: 16px;
    }
  </style>
</head>

<body>
  <pre id="content"></pre>
  <script src="./str.js"></script>
  <script>
    createTest = () => {
      // let ptt  = /[\w-]+/gi;
      // let cat = str.match(ptt);
      let res = '';
      let cat = str.split(/[\r\n]/g);
      [].forEach.call(cat, (item, index) => {
        if (index % 3 == 0) {
          let what = 'string';
          try {
            what = JSON.parse(cat[index + 2]);
          } catch (err) {

          }
          let map = cat[index + 2].match(/^[\S*]$/gi);
          console.log(item, map, what);
          res += `${item}:string\n`;
        }
      });
      console.log(res);
      // console.log(cat);
      document.getElementById("content").textContent = res;
    }
    createTest();
  </script>
</body>

</html>